<?php
namespace app\admin\validate;

use think\Validate;

class Config extends Validate
{
         protected $rule =   [
            'cnname'  => 'require|max:20|unique:config',
            'enname'   => 'require|max:20|unique:config',
            'dt_type' =>'require|number',
            'cf_type' =>'require|number',
        ];

        protected $message  =   [
           'cnname.require' =>'中文名称不得为空！',
           'cnname.max'   =>'中文名称不得超过20个字符',
           'cnname.unique' =>'中文名称不得重复',

           'enname.require' =>'英文名称不得为空！',
           'enname.max'   =>'英文名称不得超过20个字符',
           'enname.unique' =>'英文名称不得重复',

           'dt_type' => '配置类型不得为空！',
           'dt_type' =>'配置类型必须是数字',

           'cf_type' => '配置分类不得为空！',
           'cf_type' =>'配置分类必须是数字',

        ];

        protected $scene = [
            'edit'  =>  ['cnname','enname','dt_type','cf_type'],
            'add'  =>  ['cnname','enname','dt_type','cf_type'],
        ];

}












?>